lib/repo: More cleanup of load_file() internals
authorColin Walters <walters@verbum.org>
Fri, 23 Jun 2017 16:14:07 +0000 (12:14 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 23 Jun 2017 18:29:51 +0000 (18:29 +0000)
commit612c8a5fa8c2c6bccda2987bd21343d2837989f7
treee551f15fd035322d1931888a4999f1f71dce01a7
parent63ad289a9c5ec76c071469fe8db7bb61d3b114c9
lib/repo: More cleanup of load_file() internals

This is followon work from previous cleanups.  Basically
`stat_bare_content_object()` was the `fstatat()` logic
and `ostree_repo_read_bare_fd()` was the `openat()` implementation;
they duplicated some bits to find the object in staging, recurse
into parent etc.

Further, I wanted an internal-only version of this API which didn't allocate
`GFileInfo`/`GInputStream` but used a plain `fd` and `struct stat` to avoid
mallocs.

The end version here I think looks a lot nicer, since we deduplicate the various
`open()` calls in the different cases for example.

Closes: #952
Approved by: jlebon
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo-static-delta-processing.c
src/libostree/ostree-repo.c